import React, { memo, Suspense } from 'react'
import type { ReactNode } from 'react'
import { Outlet } from 'react-router-dom'
import DiscoverHeader from '@/views/discover/c-cpns/discover-nav'

interface Iprops {
    children?: ReactNode
}

const Discover: React.FC<Iprops> = () => {
    return (
        <div>
            <DiscoverHeader></DiscoverHeader>
            {/*用于处理异步加载的组件，控制展示loading*/}
            <Suspense fallback="">
                <Outlet></Outlet> {/*定义嵌套路由的渲染位置，支持子路由的展示*/}
            </Suspense>
        </div>
    )
}

export default memo(Discover) /*用于性能优化，避免不必要的重新渲染。*/
